const {ccclass, property} = cc._decorator;

@ccclass
export default class PageAdvComponent extends cc.Component {

    @property({type:cc.Button,default:[]})
    buttons: cc.Button[] = [];
@property(cc.PageView)
    pageView:cc.PageView;
    onLoad() {
        this.pageView.enabled = false
        
        // init logic
        
    }

    changePage(event,param){
        
        for(let i=0;i<this.buttons.length;i++){
            if(param==i){
                this.buttons[i].interactable = false;
            }else{
                this.buttons[i].interactable = true;
            }
        }
        this.pageView.scrollToPage(param,0)

    }

    closeCurrent(){
        this.node.active = false;
    }
}
